package com.frogs.ucenter.v1.request;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.SeedPayStatusEnum;
import com.frogs.system.web.api.request.Request;


public class SeedPayRequest extends Request{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7279623299281757779L;
	
	private String openId;
	private Integer userId = 0;
	private Integer isPay ;
	private Date seedTime;
	private Integer payPrice;
	
	public SeedPayRequest(){
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		Date time=new Date();
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.openId = requestInfo.getParameter(ApiUrlParamEnum.openId.getParamName(),null);
		this.isPay = requestInfo.getIntParameter(ApiUrlParamEnum.isPay.getParamName(), SeedPayStatusEnum.STATUS_NOT_PAY.getId());
		this.seedTime=requestInfo.getDateParameter(ApiUrlParamEnum.payTime.getParamName(), new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(time));
		this.payPrice = requestInfo.getIntParameter(ApiUrlParamEnum.seedPayPrice.getParamName(), 0);
		
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getIsPay() {
		return isPay;
	}

	public void setIsPay(Integer isPay) {
		this.isPay = isPay;
	}

	public Date getSeedTime() {
		return seedTime;
	}

	public void setSeedTime(Date seedTime) {
		this.seedTime = seedTime;
	}

	public Integer getPayPrice() {
		return payPrice;
	}

	public void setPayPrice(Integer payPrice) {
		this.payPrice = payPrice;
	}


}
